<?php
	
	$C	= new stdClass;
	$C->INCPATH		= dirname(__FILE__).'/';
	
	if( ! file_exists($C->INCPATH.'conf_main.php') ) {
		exit;
	}
	require_once($C->INCPATH.'conf_main.php');
	
	chdir( $C->INCPATH );
	
	$C->DEBUG_MODE		= in_array($_SERVER['REMOTE_ADDR'], $C->DEBUG_USERS);
	if( $C->DEBUG_MODE ) {
		ini_set( 'error_reporting', E_ALL | E_STRICT	);
		ini_set( 'display_errors',			1	);
	}
	
	$C->IMG_URL		= $C->DATA_URL.'i/';
	$C->IMG_DIR		= $C->INCPATH.'../../i/';
	$C->TMP_URL		= $C->IMG_URL.'tmp/';
	$C->TMP_DIR		= $C->IMG_DIR.'tmp/';
	

	
	ini_set( 'magic_quotes_runtime',		0	);
	ini_set( 'session.name',			my_session_name($C->DOMAIN)	);
	ini_set( 'session.cache_expire',		300	);
	ini_set( 'session.cookie_lifetime',		0	);
	ini_set( 'session.cookie_path',		'/'	);
	ini_set( 'session.cookie_domain',		cookie_domain()	);
	ini_set( 'session.cookie_httponly',		1	);
	ini_set( 'session.use_only_cookies',	1	);
	ini_set( 'session.gc_maxlifetime',		10800	);
	ini_set( 'session.gc_probability',		1	);
	ini_set( 'session.gc_divisor',		1000	);
	ini_set( 'zlib.output_compression_level',	7	);
	ini_set( 'max_execution_time',		20	);
	
	if( ! function_exists('mb_internal_encoding') ) {
		require_once( $C->INCPATH.'helpers/func_mbstring.php' );
	}
	mb_internal_encoding('UTF-8');
	
	if( ! function_exists('json_encode') ) {
		require_once( $C->INCPATH.'helpers/func_json.php' );
	}
	if( ! function_exists('strptime') ) {
		require_once( $C->INCPATH.'helpers/func_strptime.php' );
	}
	
?>